<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/common/commonCss.jsp"/>
<script src="${basePath}commonJs/jquery.min.js"></script>
<script src="${basePath}commonJs/jquery.easyui.min.js"></script>
<script src="${basePath}commonJs/jt_select.js"></script>
<script  type="text/javascript" src="${basePath }commonJs/tags/page/page.js"></script>
<script src="${basePath}commonJs/jt_normal.js"></script>
<script src="${basePath}commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript"
	src="${basePath}commonJs/ajaxfileupload.js"></script>
<script type="text/javascript">
var fujiaPrdArray=[];
var trimPrdArray=[];
var parStatus=new Array("未预付","自动取消","取消","待确认","已确认","进行中","完成","删除");
var pkParresIdOld ='${pkParresId}';
 var pkOrderIdOld='${pkOrderId}';
$(document).ready(function() {
	$("#modiTimedis").val('${parreserveOld.pmodiTime}');
	loadTypeTimeValue();
	loadParStatus();
	loadParTaocan();
	 document.getElementById("dfujiaTableDiv").style.display='block';

	 if(pkParresIdOld!=""){
		 var basicPkg2old='${parreserveOld.basicPkg2}';
		 if(basicPkg2old!=""){
			 fujiaPrdArray=basicPkg2old.split(",");
		 }
		 var basicPkg3old='${parreserveOld.basicPkg3}';
		 if(basicPkg3old!=""){
			 trimPrdArray=basicPkg3old.split(",");
		 }
		 $("#fujiaTable").remove();
		 $("#foot1").remove();
		 document.getElementById("addfujiaTableDiv").style.display='block';
		 document.getElementById("addfoot1").style.display='block';
		 initTab("addformFujia4", "addfujiaTable", "addfoot1", addTrFujia);
		 $("#trimmingtable").remove();
		 $("#foot2").remove();
		 document.getElementById("addtrimmingtableDiv").style.display='block';
		 document.getElementById("addfoot2").style.display='block';
		 initTabTrim("addformZhuangshi4", "addtrimmingtable", "addfoot2", addTrming);
	 }else{
		 fujiaPrdArray=[];trimPrdArray=[];
		 initTab("formFujia4", "fujiaTable", "foot1", initTrFujia);
		 initTabTrim("formZhuangshi4", "trimmingtable", "foot2", initTrming);
	 }
	 var resStatusOld ='${parreserveOld.resStatus}';
	 var zbBranidOld='${zbBranid}';
	 if( resStatusOld=='2'|| resStatusOld =='3'||  zbBranidOld=='ZB'){
		 hideButton();
	}
});
function hideButton(){
	 $("#byufu").hide();
     $("#cquxiao").hide();
     $("#bgenggai").hide();
     $("#blqueren").hide();
      $("#bprinthet").hide();
       $("#buphet").hide();
        $("#bprinthet").hide();
         $("#btiaoma").hide();
          $("#bprintqiandao").hide();
           $("#buploadqiandao").hide();
           $("#bokyuDing").hide();
}
	function loadTypeTimeValue() {
		var basicPkg = '${parreserveOld.basicPkg}';
		var resTimeS = '${parreserveOld.resTimeS}';
		var resTimeE = '${parreserveOld.resTimeE}';
		var overTime = '${parreserveOld.overTime}';
		if (overTime == 1) {
			$("#overTime").val("1小时");
		} else if (overTime == 2) {
			$("#overTime").val("2小时");
		}
		
	 	var fkOtprdId ='${parreserveOld.fkOtprdId}';
		if(fkOtprdId=="ZBSP141126001"){
			$("#fkOtprdId").val(fkOtprdId);
			$("#opttypeJiashi").val("小房间");
		}else if(fkOtprdId=="ZBSP141126002"){
			$("#fkOtprdId").val(fkOtprdId);
			$("#opttypeJiashi").val("大房间");
		}
		if (basicPkg != "") {
			var typeValue = basicPkg.substring(0, basicPkg.indexOf("#"));
			if (typeValue == "ZBSP1408070540") {
				typeValue = "团体4小时单人（不含餐）";
			} else if (typeValue == "ZBSP1408070541") {
				typeValue = "团体4小时单人（含餐）";
			} else if (typeValue == "ZBSP1408070542") {
				typeValue = "团体6小时单人（含餐）";
			}
			$("#typeTaocan").val(typeValue);
		}
		$("#resTimeE").val(resTimeE);
		var restsValue = resTimeS.substring(0, 2) + ":"
				+ resTimeS.substring(2, 4);
		$("#resTimeS").val(restsValue);
		if (resTimeE != "") {
			var restevalue = resTimeE.substring(0, 2) + ":"
					+ resTimeE.substring(2, 4);
			$("#showresTimeE").val(restevalue);
			refreshSelect();
		}
	}

	function loadParStatus() {
		var parstatus = '${parreserveOld.resStatus}';
		parstatus =parseInt(parstatus); 
		if(parstatus>=1){
			var parStatusName=parStatus[parstatus-1];
			document.getElementById("parstatus").innerHTML='<label>状态：</label>'+parStatusName+'  (已改期${parreserveOld.modiTimeCnt}次) ';
		}else{
			document.getElementById("parstatus").innerHTML='<label>状态：</label>'+parStatus[0];
		}
		if (parstatus == 4) {//待确认
			document.getElementById("byufu").style.display = "none";
			document.getElementById("bokyuDing").style.display = "none";
			document.getElementById("blqueren").style.display = "block";
		}
		if (parstatus == 5 || parstatus == 6) {//已确认
			document.getElementById("byufu").style.display = "none";
			document.getElementById("bokyuDing").style.display = "none";
			document.getElementById("blqueren").style.display = "block";
			document.getElementById("btiaoma").style.display = "block";
			document.getElementById("bprintqiandao").style.display = "block";
			document.getElementById("buploadqiandao").style.display = "block";

			document.getElementById("boqueren").style.display = "none";
			document.getElementById("booutputOrder").style.display = "block";
			document.getElementById("zuizongMsgDiv").innerHTML = "此预约已确认，请导出供应商订单信息。";
		}
	}

	function outputOrder(){
		var url ='${basePath }parreserve/expParSupplyPrd.shtml?pkParresId=${parreserveOld.pkParresId}';
		
		try {
			var form = document.createElement("form");
			document.body.appendChild(form);
			form.method = "post";
			form.action = url;
			form.submit();
		} catch (e) {

		}
		$('#o').window('close');
		//alertInfo("导出模版需 确认。");
		  window.location.href='${basePath }parreserve/parReserveManagesDetail.shtml?pkParresId=${parreserveOld.pkParresId}&grpFlag=1';
		
	}

	function cancelzhuizhong() {
		$('#o').window('close');
		window.location.href = '${basePath }parreserve/parReserveManagesDetail.shtml?pkParresId=${parreserveOld.pkParresId}&grpFlag=1';
	}

	function zuizhongok() {
		var pkParresIdOld = '${pkParresId}';
		var pkorderId = '${pkOrderId}';
		var url = '${basePath }parreserve/managerDetailAffirm.shtml?parType=0&pkParresId='
				+ pkParresIdOld + '&pkorderId=' + pkorderId;
		$
				.ajax({
					url : url,
					type : 'get',
					async : false,
					success : function(msg) {
						if (msg != "1") {
							if (msg == "2") {
								msg = "系统错误，获取预约数据失败。";
							} else if (msg == "3") {
								msg = "此预约 未预付金额。请先预付金额，再最终确定操作。";
							} else if (msg == "4") {
								msg = "系统错误，获取订单数据失败。";
							}
							alertWarning(msg);
							$('#o').window('close');
						} else {
							document.getElementById("byufu").style.display = "none";
							document.getElementById("bgenggai").style.display = "none";
							document.getElementById("bokyuDing").style.display = "none";
							document.getElementById("boqueren").style.display = "none";
							document.getElementById("booutputOrder").style.display = "block";
							document.getElementById("zuizongMsgDiv").innerHTML = "此预约已确认，请导出供应商订单信息。";
						}
					}
				});
	}

	function loadParTaocan() {
		var arr = [];

		var divIdP = "openCengValid('#q')";
		var divopen = '"open"';
		var taocanSize = '${gblScmTaocanSize}';
		arr.push('<table class="table">');
		if ('${listGblScmTaocan}' == '[]') {
			arr.push('<tr><td>主食1</td> ');
			arr.push('<td >&nbsp;</td></tr>');
		} else {
			<c:forEach items="${listGblScmTaocan}" var="parTaocan" varStatus="status">
			<c:choose>
			<c:when test="${status.index==0}">
			arr
					.push('<tr><td>主食1</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td>');
			arr.push('</tr>');
			</c:when>
			<c:when test="${status.index==1 }">
			arr
					.push('<tr><td>主食2</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td></tr>');
			</c:when>
			<c:when test="${status.index==2 && parTaocan.fkPrdcateId=='001007001002'}">
			arr
					.push('<tr><td>主食3</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td></tr>');
			</c:when>
			<c:otherwise>
			arr
					.push('<tr><td>${parTaocan.cateName}</td><td>${parTaocan.prdName} </td></tr>');
			</c:otherwise>
			</c:choose>
			</c:forEach>
		}
		arr.push('</table>');
		var parTaocanDiv = document.getElementById("parTaocan");
		parTaocanDiv.innerHTML = arr.join('');
	}

	function dateFormt(date) {
		var now = date;
		var dateNows = now.toLocaleDateString();
		var hours = now.getHours();
		var minutes = now.getMinutes();
		var seconds = now.getSeconds();
		return dateNows + " " + hours + ":" + minutes + ":" + seconds;
	}

	function initTab(formId, tableId, footId, initTr) {
		var form = $("#" + formId);
		var pagebean = new PageBean(form);
		pagebean.setCallback(initTr);
		pagebean.setFootId(footId);
		pagebean.setTableId(tableId);
		setPagebeanObj(pagebean);
		pagebean.doPage();
	}
	var pagebean;
	function initTabTrim(formId, tableId, footId, initTr) {
		var form = $("#" + formId);
		pagebean = new PageBean(form);
		pagebean.setCallback(initTr);
		pagebean.setFootId(footId);
		pagebean.setTableId(tableId);
		setPagebeanObj(pagebean);
		pagebean.doPage();
	}

	function addTrFujia(data) { //add后的  附加菜单 列表
		if (data != null) {
			$
					.each(
							data,
							function(ind, obj) {
								var htm = "<tr>";
								htm += "<td>" + obj.prdName + "</td>";
								htm += " <td>" + obj.productPrice + "</td>";
								var quantCount = obj.quantity;
								if (quantCount == null) {
									quantCount = 0;
								}
								htm += '<td> <input value="'+quantCount+'" type="text" name="qty" id="qty'+obj.pkPrdId+'" disabled class="iput_t w50"   ></td>';
								htm += '<td>&nbsp;</td>';
								htm += "</tr>";

								$("#addfujiaTable").find("tr:eq(" + ind + ")")
										.after(htm);
							});
		}
	}
	function addTrming(data) {//add后的 装饰 分页列表
		if (data != null) {
			$
					.each(
							data,
							function(ind, obj) {
								var htm = "<tr>";
								htm += "<td>" + obj.prdName + "</td>";
								htm += " <td>" + obj.productPrice + "</td>";
								var quantCount = obj.quantity;
								if (quantCount == null) {
									quantCount = 0;
								}
								htm += '<td><input value="'+quantCount+'" type="text" name="zhuangshiTr" id="zhuangshiTr'+obj.pkPrdId+'"   class="iput_t w50" disabled  ></td>';
								htm += '<td>&nbsp;</td>';
								htm += "</tr>";

								$("#addtrimmingtable").find(
										"tr:eq(" + ind + ")").after(htm);
							});
		}
	}

	function genggai() {
		var partype = '${parType}';
		var pkParresIdOld = '${pkParresId}';
		var pkOrderIdOld = 'guanliType@${pkOrderId}';
		if (partype == '1') {
			window.location.href = "${basePath }parreserve/tuanReserveDetail.shtml?parType=1&pkParresId="
					+ pkParresIdOld + "&pkOrderId=" + pkOrderIdOld;
		} else {
			window.location.href = "${basePath }parreserve/parReserveDetail.shtml?parType=0&pkParresId="
					+ pkParresIdOld + "&pkOrderId=" + pkOrderIdOld;
		}
	}

	function yufu() {
		var pkParresIdOld = '${pkParresId}';
		var pkorderId = '${pkOrderId}';
		if (pkorderId != "") {
			var pkOrderIdOld = 'guanliType@' + pkorderId;
			window.location.href = '${basePath }parreserve/saveNextParReserve.shtml?pkParresId='
					+ pkParresIdOld
					+ '&parType=1&orderPk='
					+ pkOrderIdOld
					+ '&zhucanPrice=${zhucanPrice}&deviceType=pc&OldpkOrderId=${OldpkOrderId}';
		} else {
			alertWarning("请先点击 '更改'按钮，完善预约信息  生成订单。");
			return;
		}
	}

	//点击 “成员条码” 按钮时，初始分配 条码 到团体预约入场表
	function createListSysCode() {
		$("#hiddenParresId").val(pkParresIdOld);
		$("#hide_loading").show();
		var url = '${basePath }parreserve/initAddSysCode.shtml?pkParresId='
				+ pkParresIdOld + '&resMemCnt=${parreserveOld.resMemCnt}';
		$
				.ajax({
					url : url,
					type : 'get',
					async : false,
					success : function(data) {
						var htm = "";
						var issyscodeFlag=true;
						if (data != null) {
							for ( var o in data) {
								if (o == "truesysCode") {
									var truesysCode =data[o];
									if(truesysCode>-1){
										alertWarning("有效条形码数为["+truesysCode+"],小于预约人数，请在系统管理中 生成或 启用 条形码。");
										issyscodeFlag=false;
										break;
									}
								}
								if(issyscodeFlag){
								if (o == "locPartyInoutList") {
									var jsonarray = data[o];
									if (jsonarray != null
											&& jsonarray.length > 0) {

										for (var k = 0; k < jsonarray.length; k++) {
											var jsonobj = jsonarray[k];
											if (jsonobj != null) {
												///==
												htm += "<tr>";
												var indexD = k + 1;
												htm += '<td>' + indexD
														+ '</td>';
												var tdUrl = "javascript:showEditInput('"
														+ jsonobj["pkPartyIoId"]
														+ "','"
														+ jsonobj["fkBcodeId"]
														+ "','"
														+ jsonobj["barCode"]
														+ "')";
												htm += '<td id="'+jsonobj["pkPartyIoId"]+'" class="lv"><a href="'+tdUrl+'">'
														+ jsonobj["barCode"]
														+ '</a></td></tr>';
												//=== 
											}
										}
										$("#tablesysCodeList").html(htm);
										$('#y').window('open');
										var pspecialist ='${parreserveOld.specialist}';
										if(""!=pspecialist){
											$("#specialist").val(pspecialist);
											refreshSelect();
										}
										
									} else {
										alertWarning("请在系统管理中 生成或 启用 条形码。");
									}
								}
							}
							
							}

						} else {
							alertWarning("系统错误，初始化条形码失败。");
						}
						$("#hide_loading").hide();
					}
				});
		$("#wristColor").val('${wristColor}');
		refreshSelect();
	}

	function showEditInput(pkPartyIoId, fkBcodeId, barCode) {
		var hiddenEdit = "hiddenEditInput('" + pkPartyIoId + "','" + fkBcodeId
				+ "','" + barCode + "')";
		var updateSyscodeok = "updateSyscode('" + pkPartyIoId + "')";
		var htm = '<input type="text" id="code'
				+ pkPartyIoId
				+ '" class="iput_t w82" onkeyup="yazhengNum(this)"><input  onclick="'+updateSyscodeok+'"  type="button" class="btn_l ml10" value="确定"><input onclick="'+hiddenEdit+'" type="button" class="btn_l ml10" value="取消">';
		var tdId = "#" + pkPartyIoId;
		$(tdId).html(htm);
	}

	function updateSyscode(pkPartyIoId) {//重新 修改 条形码
		var codetdId = "#code" + pkPartyIoId;
		var codeValue = $(codetdId).val();
		if (codeValue == "") {
			alertWarning("请输入条形码。");
		} else {
			var url = '${basePath }parreserve/updateSyscode.shtml?pkPartyIoId='
					+ pkPartyIoId + '&codeValue=' + codeValue;
			$.ajax({
				url : url,
				type : 'get',
				async : false,
				success : function(msg) {
					if (msg != null && msg != "") {
						var msgs = msg.split("@");
						if (msgs[0] == "1") {
							var tdId = "#" + pkPartyIoId;
							var tdUrl = "javascript:showEditInput('"
									+ pkPartyIoId + "','" + msgs[1] + "','"
									+ codeValue + "')";
							var htm = '<a href="'+tdUrl+'">' + codeValue
									+ '</a';
							$(tdId).html(htm);
						} else if (msgs[0] == "2") {
							msg = "输入有误，请输入其他条码。【 此条形码 或停用，或占用中，或不存在】";
							alertWarning(msg);
						} else {
							msg = "系统错误，修改条形码失败。";
							alertWarning(msg);
						}

					} else {
						alertWarning("系统错误，修改条形码失败。");
					}
				}
			});
		}
	}
	function hiddenEditInput(pkPartyIoId, fkBcodeId, barCode) {
		var tdUrl = "javascript:showEditInput('" + pkPartyIoId + "','"
				+ fkBcodeId + "','" + barCode + "')";
		var htm = '<a href="'+tdUrl+'">' + barCode + '</a';
		var tdId = "#" + pkPartyIoId;
		$(tdId).html(htm);
	}
	var codeboxArray = [];

	function saveWristColor() {//保存 腕带颜色，派对专员
		var pkParresIdOld = '${pkParresId}';
		var specialist = $("#specialist").val();
		if (specialist == "") {
			specialist = '${modiBy}';
		}
		var wristColor = $("#wristColor").val();
		if (wristColor == "") {
			$("#wristColor").val("");
			refreshSelect();
			alertWarning("请选择腕带颜色。");
		} else {
			var url = "${basePath }parreserve/saveWristColor.shtml?specialist="
					+ specialist + "&wristColor=" + wristColor + "&pkParresId="
					+ pkParresIdOld;
			$.ajax({
				url : url,
				type : 'get',
				async : false,
				success : function(msg) {
					if (msg != "1") {
						msg = "系统错误，保存腕带颜色失败。";
						alertError(msg);
					} else {
						alertInfo("保存成功。");
					}
				}
			});
			$('#y').window('close');
			window.location.href = '${basePath }parreserve/parReserveManagesDetail.shtml?pkParresId=${parreserveOld.pkParresId}&grpFlag=1';
		}
	}

	function okyuDing() {//团体确认预订按钮
		var operatetype= $('input[name="radioy"]:checked').val();
	   var msgText =" 保留预约";	 
	if(operatetype =="cancel"){
		msgText =" 取消预约";	 
		 }
		var pkParresIdOld = '${pkParresId}';
		var url = "${basePath }parreserve/okparTuantiOrderPayMent.shtml?pkParresId="
				+ pkParresIdOld + "&operatetype=" + operatetype;
		
		$.messager.confirm('提示', '确认'+msgText+'吗?', function(r) {
			if(r){
		$.ajax({
					url : url,
					type : 'get',
					async : false,
					success : function(data) {
						if (data != null) {
							var pkParresIdold;
							for ( var o in data) {
								if (o == "pkParresId") {
									pkParresIdold = data[o];
									window.location.href = '${basePath }parreserve/parReserveManagesDetail.shtml?pkParresId='
											+ pkParresIdold + '&grpFlag=1';
									alertInfo("此预约 预订成功。");
									break;
								} else if (o == "cancel") {
									window.location.href = '${basePath }/parreserve/parReserveManages.shtml?indexflag=';
									alertInfo("此预约已取消。");
									break;
								}
							}

						} else {
							$.messager.alert('提示', '保存失败！', 'error');
						}
					}
				});
			}
		 });
	}
	//上传服务合同附件
	function uploadAttachFile() {
		if ($("#ui-upload-input").val() == '') {
			alertError("请在上传前先选择文件");
			return false;
		}
		$.ajaxFileUpload({
			url : '${basePath}parreserve/uploadFile.shtml?pkParresId=${parreserveOld.pkParresId}&grpFlag=0',
			secureuri : false, //是否启用安全提交,默认为false 
			fileElementId : 'ui-upload-input', //文件选择框的id属性
			dataType : 'text', //服务器返回的格式,可以是json或xml等
			success : function(data) { //服务器响应成功时的处理函数
				data = decodeURI(data);
				if (data != "") {
					$("#fileName3").html(data);
					alertInfo("服务合同上传成功");
					$("#fkAttFile").val(data);
					
					
					$("#ui-upload-filepathtxt").val('');

				} else {
					alertError("上传失败，请重试！");
					$("#fkAttFile").val("");
					$("#ui-upload-filepathtxt").val('');

				}
			},
			error : function(XMLHttpRequest) {
				ajaxError(XMLHttpRequest);
			}
		});
	}

	//赋值浏览上传框 显示上传的文件名服务合同
	function fileName() {
		var fileName = $("#ui-upload-input").val();
		if (fileName.lastIndexOf("\\") != -1) {
			fileName = fileName.substring(fileName.lastIndexOf("\\") + 1);
		}
		$("#ui-upload-filepathtxt").val(fileName);
	}

	//上传附件签到表
	function uploadSignFile() {
		if ($("#ui-upload-input1").val() == '') {
			alertError("请在上传前先选择文件");
			return false;
		}
		$.ajaxFileUpload({
			url : '${basePath}parreserve/uploadSignFile.shtml?pkParresId=${parreserveOld.pkParresId}&grpFlag=0',
			secureuri : false, //是否启用安全提交,默认为false 
			fileElementId : 'ui-upload-input1', //文件选择框的id属性
			dataType : 'text', //服务器返回的格式,可以是json或xml等
			success : function(data) { //服务器响应成功时的处理函数‘
				data = decodeURI(data);
				if (data != "") {
					$("#fileName2").html(data);
					alertInfo("签到表上传成功");
					$("#fkAttFile").val(data);
					
					$("#ui-upload-filepathtxt1").val('');

				} else {
					alertError("上传失败，请重试！");
					$("#fkAttFile").val("");
				}
			},
			error : function(XMLHttpRequest) {
				ajaxError(XMLHttpRequest);
			}
		});
	}

	function fileName1() {
		var fileName = $("#ui-upload-input1").val();
		if (fileName.lastIndexOf("\\") != -1) {
			fileName = fileName.substring(fileName.lastIndexOf("\\") + 1);
		}
		$("#ui-upload-filepathtxt1").val(fileName);
	}

	function cancelOrder() {
		pkOrderIdOld = '${pkOrderId}';
		var cancelMoneyp = $('#cancelMoneyp').val();
		var url = '${basePath }parreserve/cancelParOrder.shtml';
		$
				.ajax({
					url : url,
					type : 'post',
					data : 'pkOrderId=' + pkOrderIdOld + '&pkParresIdOld='
							+ pkParresIdOld + '&cancelMoneyp=' + cancelMoneyp,
					async : false,
					error : function(XMLHttpRequest) {
						ajaxError(XMLHttpRequest);
					},
					success : function(msg) {
						if (msg != "") {
							alertInfo("取消 成功");
							window.location.href = '${basePath }/parreserve/parReserveManages.shtml?indexflag=';
						} else {
							alertWarning("系统错误,取消预约失败。");
						}
						$('#b').window('close');
					}
				});
	}
	function checkOrder() {
		pkOrderIdOld = '${pkOrderId}';
		var cpresDay = '${parreserveOld.presDay}';
		if (pkOrderIdOld == "") {
			cancelPodOrderAlert("是否确定要取消该预约？");//未成功预约创建订单
		} else {
			//===
			var url = '${basePath }parreserve/checkSussesParOrder.shtml';
			$.ajax({
				url : url,
				type : 'post',
				data : 'pkOrderId=' + pkOrderIdOld + '&pkParresIdOld='
						+ pkParresIdOld + '&cpresDay=' + cpresDay,
				async : false,
				error : function(XMLHttpRequest) {
					ajaxError(XMLHttpRequest);
				},
				success : function(msg) {
					if (msg != "") {
						var msgArray = msg.split("@");
						if (msgArray[0] == "4") {
							cancelPodOrderAlert("是否确定要取消该预约？");//"派对预约 的 订单 未支付,确定取消吗?"
						} else {
							$('#cancelMoneyp').val(msgArray[1]);
							$('#b').window('open');
						}
					} else {
						alertWarning("系统错误,取消预约失败。");
					}
				}
			});
			//===
		}

	}

	function cancelPodOrderAlert(msg) {
		pkOrderIdOld = '${pkOrderId}';
		$.messager
				.confirm(
						'温馨提示',msg,
						//msg + ',确定取消吗?',
						function(isOk) {
							if (isOk) {
								$
										.ajax({
											url : "${basePath }parreserve/cancelNoPayParOrder.shtml",
											data : 'pkOrderId=' + pkOrderIdOld
													+ '&pkParresIdOld='
													+ pkParresIdOld,
											type : "post",
											error : function(XMLHttpRequest) {
												ajaxError(XMLHttpRequest);
											},
											success : function(result) {
												if (result == "success") {
													alertInfo("取消成功!");
													window.location.href = '${basePath }/parreserve/parReserveManages.shtml?indexflag=';
												}
											}
										});
							}
						});
	}
	
	function downloadFilFun1()
	{
		$("#downloadSignFileForm")[0].submit();
	}
	
	function downloadFilFun2()
	{
		$("#downloadCountFileForm")[0].submit();
	}
	
	function printHetong() {
		var url = '${basePath }parreserve/printParHetong.shtml?pkParresId=${parreserveOld.pkParresId}';
		try {
			var form = document.createElement("form");
			document.body.appendChild(form);
			form.method = "post";
			form.action = url;
			form.submit();
		} catch (e) {

		}
	}
	
	function fanhuiList(){
		window.location.href ='${basePath }parreserve/parReserveManages.shtml?indexflag=';
	}
</script>
<style type="text/css">
.iput_t_1{height:22px;width:94px; line-height:22px; border:1px solid #CCC; border-radius:3px; padding:0 5px;}
.iput_t_2{height:22px;width:133px; line-height:22px; border:1px solid #CCC; border-radius:3px; padding:0 5px;}
.iput_t_3{height:22px;width:60px; line-height:22px; border:1px solid #CCC; border-radius:3px; padding:0 5px;}
</style>
<title>首页</title>
</head>
<body class="bg">

<div class="content m_auto">
    <div class="content_l mt10">
    	<ul>
 			<shiro:hasPermission name="filemanagement/listVip.shtml?type=1">
        	<li><a href="${basePath}filemanagement/listVip.shtml?type=1"><i class="nav_icon_b"></i><br>会员管理</a></li>
        	</shiro:hasPermission>
        	 <shiro:hasPermission name="filemanagement/viewVistors.shtml?type=3">
            <li><a href="${basePath}filemanagement/viewVistors.shtml?type=3"><i class="nav_icon_d"></i><br>访客管理</a></li>
            </shiro:hasPermission>
             <shiro:hasPermission name="filemanagement/listViewSingelTicket.shtml?type=2">
            <li><a href="${basePath}filemanagement/listViewSingelTicket.shtml?type=2"><i class="nav_icon_a"></i><br>非会员管理</a></li>
            </shiro:hasPermission>
             <shiro:hasPermission name="parreserve/parReserveManages.shtml?indexflag=">
            <li class=" content_hover"><a href="${basePath }parreserve/parReserveManages.shtml?indexflag="><i class="nav_icon_g"></i><br>预约管理</a></li>
            </shiro:hasPermission>
             <shiro:hasPermission name="filemanagement/customer/serviceList.shtml">
             <li><a href="${basePath}filemanagement/customer/serviceList.shtml"><i class="nav_icon_h"></i><br>客户服务</a></li>
             </shiro:hasPermission>
              <shiro:hasPermission name="crm/jumpCrm.shtml">
            <li><a href="${basePath}crm/jumpCrm.shtml"><i class="nav_icon_n"></i><br>客户关系管理</a></li>
            </shiro:hasPermission>
        </ul>
    </div>
    <div class="content_r mt10">
        <div class="mt10">
        	<div class="order_add_l">
            	<h2 class="f18 ml30">团体活动</h2>
            	<dl class="order_add_l_dl">
                	<dd><label><font color="#FF0000"><b>*</b></font>主题：</label><input disabled type="text" class="iput_t w200" id="subject" name="subject" value="${parreserveOld.subject}">&nbsp;</dd>
                    <dd><label><font color="#FF0000"><b>*</b></font>联系人：</label><input disabled type="text" class="iput_t w200" id="conName" value="${parreserveOld.conName}" name="conName" >&nbsp;</dd>
                    <dd><label>固话：</label><input disabled type="text" class="iput_t w200"  id="conTel" name="conTel" value="${parreserveOld.conTel}">
                    	<input type="hidden" name="pkOrderId" id="pkOrderId" value="${pkOrderId}"><input type="hidden" name="grpFlag" id="grpFlag" value="${parType}">
                    </dd>
                    <dd><label><font color="#FF0000"><b>*</b></font>手机 ：</label><input disabled type="text" class="iput_t w200" value="${parreserveOld.conMobile}" id="conMobile" name="conMobile" >&nbsp;</dd>
                    <dd><label>Email：</label><input disabled type="text" name="conEmail" id="conEmail" class="iput_t w200" value="${parreserveOld.conEmail}"></dd>
                    <dd><label><font color="#FF0000"><b>*</b></font>房间：</label>
                    	 <input type="text"  value="${parreserveOld.roomIds}"   class="iput_t w200" disabled>
                    	  
                    </dd>
                    <dd><label><font color="#FF0000"><b>*</b></font>日期：</label><input disabled type="text" id="presDay" name="presDay" value="${parreserveOld.presDay}"
					class="Wdate iput_t w200"   disabled />&nbsp;</dd>
					 <dd><label><font style="color:#F00">*</font>类型：</label>
					  <input type="text" name="typeTaocan" id="typeTaocan"    class="iput_t w200" disabled>
				
                    </dd>
                     <dd><label> <font style="color:#F00">*</font>开始时间：</label>
                     
  				  <span id="sel_end"  >
  				   <input type="text" name="resTimeS" id="resTimeS"    class="iput_t w100" disabled>
    				 <span class="ml5">-</span>
                         	 <input type="text" name="showresTimeE" id="showresTimeE"    class="iput_t w100" disabled>
   							<input type="hidden" name="resTimeE" id="resTimeE"  >
                       </span>
                    </dd>
                   <dd><label>加时：</label><input disabled type="text" class="iput_t_2" name="overTime" id="overTime" ></dd>
                    <dd><label>加时房间类型：</label><input disabled type="text" class="iput_t_2"   id="opttypeJiashi" >
					 <input  type="hidden"  type="text" class="iput_t_2" name="fkOtprdId" id="fkOtprdId" ></dd>
                    <dd><label><font color="#FF0000"><b>*</b></font>人数：</label><input disabled type="text" class="iput_t_2" name="resMemCnt" value="${parreserveOld.resMemCnt}" id="resMemCnt"><span class="color_9c9"> </span>&nbsp;</dd>
                    <dd><label>备注：</label><textarea disabled name="comments" id="comments"  class="textare w200 h80">${parreserveOld.comments}</textarea></dd>
                    <dd><label>操作时间：</label><input type="text" name="modiTimedis" id="modiTimedis"  class=" iput_t w200"    disabled > </dd>
                    <dd><label>操作人：</label><input type="text"   class=" iput_t w200" value="${modiName}"   disabled >
                    <input type="hidden" name="modibydis"  id="modibydis" class=" iput_t w200" value="${modiBy}"    ></dd>
                     <dd id="parstatus"></dd>   
                    
                </dl>
            </div>
            <div class="order_add_r">
				<dl class="order_add_r_dl">
					<dd>
						<h2>搭配套餐：</h2>
                        <div id="parTaocan">
                        </div>
                    </dd>
                    <dd>
                        <h2>附加菜单：</h2>
                         <div id="dfujiaTableDiv" style="display:none">
                        <table class="table" id="fujiaTable">
                            <tr>
                                <th>商品</th>
                                <th>价格(元)</th>
                                <th>数量</th>
                                <th>操作</th>
                            </tr>
                            
                        </table>
                        </div>
                          <div id="addfujiaTableDiv" style="display:none">
                      	  <table class="table" id="addfujiaTable"  >
                            <tr>
                                <th>商品</th>
                                <th>价格(元)</th>
                                <th>数量</th>
                                <th>操作</th>
                            </tr>
                       	 </table>
                         </div>
                    </dd>
                    <dd>&nbsp;
                    <div class="page fr m10" id="foot1">
							</div>
							<div class="page fr m10" id="addfoot1"  >
                    </dd>
                    </br>
                    <dd>
                        <h2>装饰物：</h2>
                      	  <table class="table" id="trimmingtable"  >
                        </table>
                        <div id="addtrimmingtableDiv" style="display:none">
	                        <table class="table" id="addtrimmingtable"  >
	                            <tr>
	                                <th>商品</th>
	                                <th>价格(元)</th>
	                                <th>数量</th>
	                                <th>操作</th>
	                            </tr>
	                        </table>
                        </div>
                    </dd>
                    <dd>&nbsp;
                    	<div class="page fr m10" id="foot2">
							</div>
							<div class="page fr m10" id="addfoot2"  style="display:none">
                    </dd>
				</dl>
            </div>
        </div>
        <div class="clear"></div>
        <form action="${basePath }parreserve/paginateFujia.shtml" method="post" id="formFujia4">
							<input type="hidden" name="pageSize" value="4"> <input
								type="hidden" name="pageNo" value="1">  
		</form>
        <form action="${basePath }parreserve/paginateZhuangshi.shtml" method="post" id="formZhuangshi4">
		<input type="hidden" name="pageSize" value="4"> <input
			type="hidden" name="pageNo" value="1">  
	</form>
	
	        <form action="${basePath }parreserve/addPageFujia.shtml?addType=fujia" method="post" id="addformFujia4">
							<input type="hidden" name="pageSize" value="4"> <input
								type="hidden" name="pageNo" value="1"> 
								<input type="hidden" name="basicPkg2" id="addbasicPkg2" value="${parreserveOld.basicPkg2}">
		</form>
        <form action="${basePath }parreserve/addPageZhuangshi.shtml?addType=zhuangs" method="post" id="addformZhuangshi4">
		<input type="hidden" name="pageSize" value="4"> <input
			type="hidden" name="pageNo" value="1">  
			<input type="hidden" name="basicPkg3" id="addbasicPkg3" value="${parreserveOld.basicPkg3}"> 
	</form>
	 <form action="${basePath}common/downloadAttFile.shtml" id="downloadSignFileForm" method="post">
       		<input type="hidden" name="fkSignFile" value="${fkSignFile}">
       		<input type="hidden" name="keySignFile" value="${keySignFile}">
       </form>
       
        <form action="${basePath}common/downloadAttFile.shtml" id="downloadCountFileForm" method="post">
       		<input type="hidden" name="fkContactFile" value="${fkContactFile}">
       		<input type="hidden" name="keyContactFile" value="${keyContactFile}">
       </form>
       
        <div class="btm_btn m10">
            <dl>
                <dd><input type="button" value="返回" onClick="fanhuiList();" class="btn"></dd>
                <dd><input type="button" id="byufu" value="预付" class="btn" onClick="yufu()"></dd>
                 <dd><input type="button" id="bokyuDing" value="确认预订" class="btn" onClick="$('#a').window('open')"></dd>
                <dd><input type="button" id="bgenggai" value="更改" class="btn" onClick="genggai()"></dd>
                <dd><input type="button" id="cquxiao" value="取消" onClick="checkOrder()" class="btn"></dd>
                 <dd><input type="button" id="blqueren" style="display:none" value="最终确认" class="btn" onClick="$('#o').window('open')"></dd>
                <dd><input type="button" id="bprinthet" onclick="printHetong()"  value="打印服务合同" class="btn w100"></dd>
                <dd><input type="button" id="buphet"   value="上传服务合同" class="btn w100" onClick="$('#c').window('open')"></dd>
                <dd><input type="button" id="btiaoma" style="display:none" value="成员条码" class="btn" onClick="createListSysCode()"></dd>
                <dd><input type="button" id="bprintqiandao" value="打印签到表" class="btn w100"></dd>
                <dd><input type="button" id="buploadqiandao" value="上传签到表" class="btn" onClick="$('#g').window('open')"></dd>
            </dl>
        </div>
    </div>
</div>

 
<!---弹出层--->
<div id="o" class="easyui-window" title="最终确认" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:500px; height:200px; position:relative;">
	
    <div class=" mt50 tc f16" id="zuizongMsgDiv">
    	客户确认此次预订，不再做更改！
    </div>
    
    <div class="btm_btn btm_bg">
    	<dl>
        	<dd><input type="button" id="booutputOrder" style="display:none" class="btn" onClick="outputOrder()" value="导出供应商订单"></dd>
            <dd><input type="button" id="boqueren" class="btn" onClick="zuizhongok()" value="确定"></dd>
            <dd><input type="button" class="btn" onClick="cancelzhuizhong()" value="取消"></dd>
        </dl>
    </div>
</div>
<!---弹出层--->


<!---弹出层--->
<div id="y" class="easyui-window" title="成员条码" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:500px; height:450px; position:relative;">
	
		 <div class="dl_dd_label fixed mt10">
		            <dl>
		                <dd>
		                    <label>派对专员：</label>
			                    <div class="uboxstyle">
			                        <select name="specialist" id="specialist">
			                            <option value="">请选择</option>
			                            <c:forEach items="${listuserPar}" var="userP" >
			                            <option value="${userP.pkUsrId}">${userP.usrName}</option>
			                            </c:forEach>
			                             
			                        </select>
			                    </div>
		                </dd>
		                <dd class="mt10">
		                    <label>腕带颜色：</label>
		                    <div class="uboxstyle">
		 						    <select name="wristColor" id="wristColor">
		           					  <option value="" >请选择</option>
		           					  <c:forEach items="${gblParCWricorList}" var="parCwricor">
		           					    <option value="${parCwricor.pkWricorId}" >${parCwricor.wricorDesc}</option>
		           					  </c:forEach>
		                        </select>
		                    </div>
		                </dd>
		                </br>
		            </dl>
		        </div> 
		        <br/>
	 <div id="scrollTable" style="width:460px !important; margin-left:20px;">
        <table class="table" id="bCodeTable">
            <col width="80px"></col>
            <col></col>
            <tbody>
                <tr>
                    <th>编号</th>
                    <th>条码</th>
                </tr>
            </tbody>
        </table>
        <div style="height:204px !important">
        <table class="table">
            <col width="80px"></col>
            <col></col>
            <tbody id="tablesysCodeList">
            
            </tbody>
        </table>
        </div>
    </div>
      
    
    <div class="btm_btn btm_bg">
    	<dl>
			<dd><input type="button" id="codeSave" class="btn" onClick="saveWristColor()" value="保存"></dd>
			<dd><input type="button" id="codeCancel" class="btn" onClick="$('#y').window('close')" value="取消"></dd>
			
			<dd><form action="${basePath }parreserve/downLoadBcode.shtml" method="post" id="downLoadForm">
			<!-- <input type="submit" id="codeCancel" class="btn"  value="导出条码"> -->
			<input type="hidden" name="fkParresId" id="hiddenParresId">
			</form></dd>
        </dl>
    </div>
</div>
<!---弹出层--->



<!---弹出层--->
<div id="a" class="easyui-window f16" title="确认预约" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:400px; height:200px; position:relative;">
	
    <div class=" ml60">
    	<ul class="ul_radio m30">
        	<li><input type="radio" name="radioy" id="radio1" checked value="save" class="mr5">保留预约</li>
            <li><input type="radio" name="radioy" id="radio2"  value="cancel"  class="mr5">取消预约</li>
        </ul>
    </div>
    
    <div class="btm_btn btm_bg">
    	<dl>
			  <dd><input type="button" class="btn" onClick="okyuDing()" value="确定"></dd>  
			<dd><input type="button" class="btn" onClick="$('#a').window('close')" value="关闭"></dd>
        </dl>
    </div>
</div>
<!---弹出层--->

 


<!---弹出层--->
<div id="c" class="easyui-window" title="服务合同" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px; height:200px; position:relative;">
	<div class="shangchuan">
        <ul class="details_ul">
            <li class="lv"><label>已 上传合同：</label><a href="" onclick="downloadFilFun2();" ><span id="fileName3">${fkContactFile}</span></a></li>
            <li><label class="fl">选择扫描文件：</label>
			<div class="upload_box fl">
				<input type="text" id="ui-upload-filepathtxt" class="iput_t w200">
				<span id="ui-upload-holder fr"> <input type="file"
				class="ui-upload-input"	id="ui-upload-input" name="file" onchange="fileName()">
				</span> <input type="button" class="btn_l ml10" value="浏览">
			</div>
			</li>
        </ul>
    </div>
    <div class="btm_btn btm_bg">
    	<dl>
        		<dd>
					<input type="button" class="btn" onclick="uploadAttachFile()" value="导入">
				</dd>

				<dd>
					<input type="button" class="btn" onclick="$('#c').window('close')"
						value="取消">
				</dd>
        </dl>
    </div>
</div>
<!---弹出层--->




<!---弹出层--->
<div id="g" class="easyui-window" title="签到表上传" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px; height:200px; position:relative;">
	<div class="shangchuan">
        <ul class="details_ul">
            <li class="lv"><label>已上传签到表
            ：</label><a href="" onclick="downloadFilFun1();" ><span id="fileName2">${fkSignFile}</span></a></li>
            <li><label class="fl">选择扫描文件：</label>
			<div class="upload_box fl">
				<input type="text" id="ui-upload-filepathtxt1" class="iput_t w200">
				<span id="ui-upload-holder fr"> <input type="file"
				class="ui-upload-input"	id="ui-upload-input1" name="file" onchange="fileName1()">
				</span> <input type="button" class="btn_l ml10" value="浏览">
			</div>
			</li>
        </ul>
    </div>
		<div class="btm_btn btm_bg">
			<dl>
				<dd>
					<input type="button" class="btn" onclick="uploadSignFile()" value="导入">
				</dd>

				<dd>
					<input type="button" class="btn" onclick="$('#g').window('close')"
						value="取消">
				</dd>
			</dl>
</div>
</div>
<!---弹出层--->

<!---弹出层:更改取消--->
<div id="b" class="easyui-window f16" title="取消" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:450px; height:300px; position:relative;">
    <div class="tab_normal">
        <p class="tab_normal_p">1. 举办日期>=30天后，允许取消，退款90%<br>
2. 举办日期在15~30天之间，允许取消，退款50%<br>
3. 举办日期在15之内取消，收取100%违约金</p>
 <div class="file_dic m10 mt40">
                	退款：<input type="text" id="cancelMoneyp" class="iput_t" value="600"><input type="button" class="btn ml10" value="下单结算">
                </div>
                 <div class="btm_btn btm_bg">
    	<dl>
			<dd><input type="button" class="btn" onClick="cancelOrder()" value="确定"></dd>
			<dd><input type="button" class="btn" onClick="$('#b').window('close')" value="取消"></dd>
        </dl>
    </div>
    
   
</div>
</div>



 <div id="hide_loading">
	<div class="loading"></div>    
    <div class="loading_bg"></div>	 
</div>
</body>
</html>
















